import api from './auth'

export const departmentAPI = {
  // 获取所有部门
  getDepartments: () => api.get('/department'),

  // 获取单个部门
  getDepartmentById: (id) => api.get(`/department/${id}`),

  // 新增部门
  addDepartment: (data) => api.post('/department', data),

  // 修改部门
  updateDepartment: (id, data) => api.put(`/department/${id}`, data),

  // 删除部门
  deleteDepartment: (id) => api.delete(`/department/${id}`)
}

export default departmentAPI
